import './assets/main.css'
import router from '@/router'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus' // 导入样式库
import { apiRequest } from '@/api/apiService';
import commercePage from '@/views/CommercePage.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


const app = createApp(commercePage)
app.provide('pageTitle', 'Demo电商项目');

app.use(createPinia())
app.use(ElementPlus, { size: 'small', zIndex: 3000 }) // 使用样式库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 将apiService实例挂载到Vue实例的原型上，实现全局调用
app.config.globalProperties.$apiService = apiRequest;
app.use(router)
app.mount('#app')
